package com.ruoyi.labour.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.labour.domain.LabourUploadCard;
import com.ruoyi.labour.domain.vo.PageVo;
import com.ruoyi.labour.service.UploadCardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/uploadCard")
@Api(tags = "上传身份证")
public class UploadCardController {

    @Autowired
    private UploadCardService uploadCardService;

    /**
     * 修改身份证状态
     * @param
     * @return
     */
    @ApiOperation("修改身份证状态")
    @PostMapping("/updateUploadCard/{status}/{id}")
    public R updateUploadCard(@PathVariable("status") Integer status,
                              @PathVariable("id") Integer id){
        return uploadCardService.updateUploadCard(status,id);
    }

    /**
     *查询身份证
     * @param pageVo
     * @return
     */
    @ApiOperation("查询身份证")
    @PostMapping("/selectCard")
    public R selectCard(@RequestBody PageVo pageVo){
        return uploadCardService.selectCard(pageVo);
    }

    /**
     * 根据id查询身份证
     * @param id
     * @return
     */
    @ApiOperation("根据id查询身份证")
    @PostMapping("/selectBusiness/{id}")
    public R selectBusiness(@PathVariable Integer id){
        return uploadCardService.selectBusiness(id);
    }

}
